#include <stdio.h>


void cp_arr(double source[], double target[], int length);
void cp_ptr(double *source, double *target, int length);

int main(void)
{

	double source[7] = {1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7};
	double target[3];

	cp_ptr(source + 2, target, 3);

}

void cp_arr(double source[], double target[], int length)
{
	int i;

	for(i = 0; i < length; i++)
	{
		target[i] = source[i];
		printf("target[%d] is %.2f\n", i, target[i]);
	}
}


void cp_ptr(double *source, double *target, int length)
{

	int i;

	for(i = 0; i < length; i++)
	{
		target[i] = *(source + i);
		printf("target[%d] is %.2f\n", i, *(target + i));
	}
}


